using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using AlumnosBD;

namespace Alumnos
{
    public partial class Alumnos : Form
    {
        public Alumnos()
        {
            InitializeComponent();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void ArbreSelector_AfterSelect(object sender, TreeViewEventArgs e)
        {
            AlumnosService servei = new AlumnosService(); 
            DataTable ret;
             switch ( e.Node.Name) {
                 case "Alumnes":

                     ret = servei.Alumnes();
                     Vista.DataSource = ret;
                     
                     break;
                 case "Persones":
           
                     string cp = "";
                     cp = "08080";  //  InputBox("CP", "08080", string.Empty, 100, 100);
                     ret = servei.Persones( cp);
                     Vista.DataSource = ret;

                     break;
                 case "Asignatures":
                     break;
                 case "Notes":
                     break;
                 default:
                     break;
             }
        }
    }
}